package com.flick.base.ctrl;

import com.flick.base.service.QueryAndOperateServ;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * @author flick on 2017/4/27.
 * @version 1.0
 */
public class QueryAndOperateCtrl<T,Serv extends QueryAndOperateServ> extends QueryCtrl<T,Serv> {
    @Autowired
    Serv serv;

    @RequestMapping(method = RequestMethod.POST)
    public void save(T t) throws Exception{
        serv.save(t);
    }

    @RequestMapping(value = "/{id}",method = RequestMethod.DELETE)
    public void del(@PathVariable String id) throws Exception{
        serv.del(id);
    }
    @RequestMapping(params = {"ids"},method = RequestMethod.DELETE)
    public void dels(@RequestParam String ids) throws Exception{
        serv.dels(ids);
    }
}
